import { showRouterAPI } from '@/api/router'

const state = {
  routerList: []
}

const mutations = {
  addRouterList(state, List) {
    state.routerList = List
  }
}

const actions = {
  async showViews(context) {
    const res = await showRouterAPI()
    context.commit('addRouterList', res.data.data)
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
